﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
namespace ToaThuoc_PAK.Handler
{
    /// <summary>
    /// Summary description for XML_LoadDanhMucICD
    /// </summary>
    public class XML_LoadDanhMucICD : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            DAL_ICD10 dal_ICD10 = new DAL_ICD10();
            DataTable dt = dal_ICD10.LoadDanhMucICD();
            string xmlReturn = "<Root>";
            foreach (DataRow row in dt.Rows)
            {
                xmlReturn += "<ChanDoan CICD10='" + Factory.emptyNull(row["CICD10"]) + "' " +
                             "          VVIET='" + Factory.emptyNull(row["VVIET"]) + "' " +
                             "></ChanDoan>";
            }
            xmlReturn += "</Root>";
            context.Request.ContentType = "text/xml";
            context.Response.Write(xmlReturn);

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

    }
}